/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package ec.edu.espe.distribuidas.aseguradora.modelo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;

/**
 *
 * @author pacodell
 */
@Entity
@Table(name = "cliente", catalog = "distribuidasjsf", schema = "")
@NamedQueries({
    @NamedQuery(name = "Cliente.findAll", query = "SELECT c FROM Cliente c")})
public class Cliente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "COD_CLIENTE")
    private Integer codCliente;
    @Size(max = 250)
    @Column(name = "CLI_NOMBRE")
    private String cliNombre;
    @Size(max = 250)
    @Column(name = "CLI_DIRECION")
    private String cliDirecion;
    @Size(max = 12)
    @Column(name = "CLI_TELEFONO")
    private String cliTelefono;
    @Size(max = 30)
    @Column(name = "CLI_GENERO")
    private String cliGenero;
    @OneToMany(mappedBy = "codCliente")
    private List<Poliza> polizaList;
    @OneToMany(mappedBy = "codCliente")
    private List<Factura> facturaList;
    @OneToMany(mappedBy = "codCliente")
    private List<Dependiente> dependienteList;
    @OneToMany(mappedBy = "codCliente")
    private List<Siniestro> siniestroList;

    public Cliente() {
    }

    public Cliente(Integer codCliente) {
        this.codCliente = codCliente;
    }

    public Integer getCodCliente() {
        return codCliente;
    }

    public void setCodCliente(Integer codCliente) {
        this.codCliente = codCliente;
    }

    public String getCliNombre() {
        return cliNombre;
    }

    public void setCliNombre(String cliNombre) {
        this.cliNombre = cliNombre;
    }

    public String getCliDirecion() {
        return cliDirecion;
    }

    public void setCliDirecion(String cliDirecion) {
        this.cliDirecion = cliDirecion;
    }

    public String getCliTelefono() {
        return cliTelefono;
    }

    public void setCliTelefono(String cliTelefono) {
        this.cliTelefono = cliTelefono;
    }

    public String getCliGenero() {
        return cliGenero;
    }

    public void setCliGenero(String cliGenero) {
        this.cliGenero = cliGenero;
    }

    public List<Poliza> getPolizaList() {
        return polizaList;
    }

    public void setPolizaList(List<Poliza> polizaList) {
        this.polizaList = polizaList;
    }

    public List<Factura> getFacturaList() {
        return facturaList;
    }

    public void setFacturaList(List<Factura> facturaList) {
        this.facturaList = facturaList;
    }

    public List<Dependiente> getDependienteList() {
        return dependienteList;
    }

    public void setDependienteList(List<Dependiente> dependienteList) {
        this.dependienteList = dependienteList;
    }

    public List<Siniestro> getSiniestroList() {
        return siniestroList;
    }

    public void setSiniestroList(List<Siniestro> siniestroList) {
        this.siniestroList = siniestroList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codCliente != null ? codCliente.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cliente)) {
            return false;
        }
        Cliente other = (Cliente) object;
        if ((this.codCliente == null && other.codCliente != null) || (this.codCliente != null && !this.codCliente.equals(other.codCliente))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ec.edu.espe.distribuidas.aseguradora.modelo.Cliente[ codCliente=" + codCliente + " ]";
    }
    
}
